Tap generate docs: anyOf support and improved error messages #476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the following improvements to
tap-generate-docs
:array
with noitems
fieldobjects
andproperties
anyOf
in schemasI highly recommend hiding whitespace changes while reviewing the PR.
anyOf
designconvert-multiary-type
already supports schemas with a array for the type of the field.docs/scripts/tap-generate-docs/test/tap_generate_docs_test.clj
Lines 243 to 247 in cb6bbe1
So to support
anyOf
, this PR merges all of the maps in theanyOf
array and lets the the existing functions handle the parsing.Notice the test case I added to
convert-multiary-type-tests
mirrors the test case right above it (except mine usesanyOf
) and the outputs are expected to be the same.Outstanding questions
maybe-remove-anyOf
?remove-anyOf
without my anonymous function passed tomerge-with
?